package com.wzz.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.wzz.entity.ExamRecord;
import com.wzz.vo.PageResponse;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


public interface ExamRecordService extends IService<ExamRecord> {
    /**
     * 根据用户获取考试成绩
     * @param username
     * @param examId
     * @param pageNo
     * @param pageSize
     * @return
     */
    PageResponse<ExamRecord> getUserGrade(String username, Integer examId, Integer pageNo, Integer pageSize);

    /**
     * 创建证书
     * @param response
     * @param examName
     * @param examRecordId
     */
    void createExamCertificate(HttpServletResponse response, String examName, Integer examRecordId);

    /**
     * 获取根据id获取考试记录
     * @param recordId
     * @return
     */
    ExamRecord getExamRecordById(Integer recordId);

    /**
     * 添加考试记录
     * @param examRecord
     * @param request
     * @return
     */
    Integer addExamRecord(ExamRecord examRecord, HttpServletRequest request);

    /**
     * 获取考试记录
     * @param examId
     * @param pageNo
     * @param pageSize
     * @return
     */
    PageResponse<ExamRecord> getExamRecord(Integer examId, Integer pageNo, Integer pageSize);

    /**
     * 设置考试问题来源
     * @param totalScore
     * @param examRecordId
     */
    void setObjectQuestionScore(Integer totalScore, Integer examRecordId);
}
